package com.example.backendmanage.mapper;

import com.example.backendmanage.info.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    @Select("insert into sys_role(name,description) values(#{name},#{description})")
    int AddRole(Role role);

    @Select("select * from sys_role")
    List<Role> findAll();

    @Select("select * from sys_role where " +
            "name like concat('%',#{name},'%') and description like concat('%',#{description},'%') " +
            "limit #{pageIndex},#{pageSize}")
    List<Role> findPage(Integer pageIndex,Integer pageSize,String name,String description);

}
